﻿@using S4Store.Domain
@{
    S4Store.Domain.Administrator CurrentUser = (S4Store.Domain.Administrator)ViewBag.CurrentUser;
}
@model S4Store.Models.TelSaleReport.ByPersonModel
@{
    Layout = null;
    ViewBag.Title = "ByPerson";
}
<div style="height:100%; overflow:auto">
<div style=" width:100%; height:30px; background:#E5EDEF">
    <div ratio="#25" class="panelBar" style="height: 25px;">
	<ul class="toolBar">
		<li class="historyrecord"><a   href="@Url.Action("Customer", new { SearchSellerId = Model.Seller.Id })" target="navtab"><span class="icon search">查询历史数据(@Model.Seller.Name)</span></a></li>
		@if (
                           CurrentUser.Position == S4Store.Domain.Position.SystemManager ||
                           CurrentUser.Position == S4Store.Domain.Position.SaleTutors ||
                           CurrentUser.Position == S4Store.Domain.Position.DealerTutors
                           )
		{
		<li class="historyrecord"><a  backtype="html" href="@Url.Action("AddImproveGuide", "ImproveGuide", new { guidetype = S4Store.Domain.ImproveGuide.ImproveGuideType.Sale.ToInt()  ,referdesc="销售管理>电话销售业绩动态>人员查询>人员查询"})" target="dialog" width="60%"><span class="icon edit">填写改善指导建议</span></a></li>
		}
	</ul>
</div>
</div>
        <table  class="reporttable"  style="border-collapse:collapse;">     
<tr height="198" style="height:148.5pt" class="vtr">
    <th width="60"  class="inputedheader"><div>销售顾问姓名</div></th>
    <th width="65"  class="inputedheader"><div>车型</div></th>
    <th   class="calculated"><div>电话客户接待目标</div></th>
    <th class="inputedheader"><div>月初尚存意向客户数</div></th>
    <th class="inputedheader"><div>电话客户接待数</div></th>
    <th   class="calculated"><div>电话邀约招徕目标</div></th>
    <th  class="inputedheader"><div>电话招徕到店数</div></th>

    <th   class="inputedheader"><div>有效A卡建卡数</div></th>
    <th class="inputedheader"><div>试驾邀请书填写数</div></th>
    <th  class="inputedheader"><div>试驾客户未成交数</div></th>
    <th  class="inputedheader"><div>商谈明细表填写数</div></th>
    <th   class="inputedheader"><div>超限价格成交数</div></th>
    <th   class="inputedheader"><div>上月遗留客户新增订单</div></th>
    <th   class="inputedheader"><div>当月客户新增订单数</div></th>
    <th   class="inputedheader"><div>交车数</div></th>

    <th   class="inputedheader"><div>二次成功邀约客户数</div></th>
    <th   class="inputedheader"><div>老客户推荐成交数</div></th>
    <th   class="inputedheader"><div>当月销量目标</div></th>

    <th   class="calculated"><div>销量完成进度</div></th>
    <th   class="calculated"><div>销量进度差</div></th>
    <th   class="calculated"><div>来店批次完成进度</div></th>
    <th   class="calculated"><div>来店批次进度差</div></th>
    <th   class="calculated"><div>当月登记客户完成进度</div></th>

    <th   class="calculated"><div>登记客户进度差率</div></th>
    <th   class="calculated"><div>当月目标完成率</div></th>
    <th   class="calculated"><div>电话招徕到店率</div></th>
    <th   class="calculated"><div>A卡需求完整分析率</div></th>
    <th   class="calculated"><div>试乘试驾率</div></th>

    <th   class="calculated"><div>试乘试驾未成交率</div></th>
    <th   class="calculated"><div>商谈明细表填写率</div></th>
    <th   class="calculated"><div>上月遗留客户转化率</div></th>
    <th   class="calculated"><div>当月登记客户成交率</div></th>
    <th   class="calculated"><div>订单交车转化率</div></th>

    <th   class="calculated"><div>超限成交率</div></th>    
    <th   class="calculated"><div>二次邀约成功率</div></th>
    <th   class="calculated"><div>老客户推荐成功率</div></th>


</tr>
@foreach (var seller in Model.SellerKpiPersonBodyModel.Sellers)
{
    var brands = Model.SellerKpiPersonBodyModel.GetCarBrands(seller);
    int i = 0;
    foreach (var brand in brands)
    {
        var report = Model.SellerKpiPersonBodyModel.GetReportByBrandAndSeller(seller, brand);
        <tr height="26" style="height:19.5pt" class="xl65">
                        @if (i++ == 0)
                        {
                            <td rowspan="@brands.Count">@seller.Name</td>
                        }
                        <td>@brand.Name</td>
                        <td class="calculated">@report.SCLDHJDMB.toInt()</td>
                        <td>@report.YCSCYXKHS</td>
                        <td>@report.LDJDPC</td>
                        <td class="calculated">@report.SCLDDJMB</td>
                        <td>@report.SCLDKHDJS</td>

                        <td>@report.YXAKJKS</td>
                        <td>@report.SJYQSTXS</td>
                        <td>@report.SJKHCJS</td>
                        <td>@report.STMXBTXS</td>
                        <td>@report.CXJGCJS</td>
                        <td>@report.SYYLKHXZDD</td>
                        <td>@report.DYKHXZDD</td>
                        <td>@report.JCS</td>
                        <td>@report.ECCGYYKHS</td>
                        <td>@report.DYLKHTJCJS</td>
                        <td>@report.SaleTarget</td>

                       <td class="calculated" @S4Store.Utils.GetBgColor(report.XLWCD >= report.RateOfTime)>@report.XLWCD.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.XLJDC >= 0)>@report.XLJDC.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.LDPCWCD >= report.RateOfTime)>@report.LDHPCWCD.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.LDHPCJDC >= 0)>@report.LDHPCJDC.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.DJKHWCJD >= report.RateOfTime)>@report.DJKHWCJD.toInt()%</td>
                        
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.DJKHJDC >= 0)>@report.DJKHJDC.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.SaleRate >= report.RateOfTime)>@report.SaleRate.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.SCLDDJLV >= report.SellerPerformanceStandard.SCLDDJLV)>@report.SCLDDJLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.AKXQWZFXLV >= report.SellerPerformanceStandard.AKXQWZFXLV)>@report.AKXQWZFXLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.SCSJLV >= report.SellerPerformanceStandard.SCSJLV)>@report.SCSJLV.toInt()%</td>
                        
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.SCSJCJLV <= report.SellerPerformanceStandard.SCSJCJLV)>@report.SCSJCJLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.STMXBTXLV >= report.SellerPerformanceStandard.STMXBGTXLV)>@report.STMXBTXLV.toInt()%</td>
                        <td class="calculated"  @S4Store.Utils.GetBgColor(report.SYKHZHLV >= report.SellerPerformanceStandard.SYKHZHLV)>@report.SYKHZHLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.DYDJKHCJLV >= report.SellerPerformanceStandard.DJKHCJLV)>@report.DYDJKHCJLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.DDJCZHLV >= report.SellerPerformanceStandard.DDJCZHLV)>@report.DDJCZHLV.toInt()%</td>
                        
                        <td class="calculated" @S4Store.Utils.GetBgColor(report.CXJGCJLV >= report.SellerPerformanceStandard.CXJGCJLV)>@report.CXJGCJLV.toInt()%</td>
                        
                        <td class="calculated"  @S4Store.Utils.GetBgColor(report.ECYYCGLV >= report.SellerPerformanceStandard.ECYYCGLV)>@report.ECYYCGLV.toInt()%</td>
                        <td class="calculated"  @S4Store.Utils.GetBgColor(report.LKHTJCGLV >= report.SellerPerformanceStandard.LKHTJCGLV)>@report.LKHTJCGLV.toInt()%</td>
                    </tr>
    }
        <tr height="26" style="height:19.5pt" class="xl65">                        
                            <td colspan="2">数据小计</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.PersonReport.SCLDHJDMB.toInt()</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.YCSCYXKHS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.LDJDPC</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.PersonReport.SCLDDJMB</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.SCLDKHDJS</td>

                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.YXAKJKS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.SJYQSTXS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.SJKHCJS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.STMXBTXS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.CXJGCJS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.SYYLKHXZDD</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.DYKHXZDD</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.JCS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.ECCGYYKHS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.DYLKHTJCJS</td>
                        <td>@Model.SellerKpiPersonBodyModel.PersonReport.SaleTarget</td>

                       <td class="calculated"  @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.XLWCD >= Model.SellerKpiPersonBodyModel.PersonReport.RateOfTime)>@Model.SellerKpiPersonBodyModel.PersonReport.XLWCD.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.XLJDC >= 0)>@Model.SellerKpiPersonBodyModel.PersonReport.XLJDC.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.LDHPCWCD >= Model.SellerKpiPersonBodyModel.PersonReport.RateOfTime)>@Model.SellerKpiPersonBodyModel.PersonReport.LDHPCWCD.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.LDHPCJDC >= 0)>@Model.SellerKpiPersonBodyModel.PersonReport.LDHPCJDC.toInt()%</td>
                        <td class="calculated"  @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.DJKHWCJD >= Model.SellerKpiPersonBodyModel.PersonReport.RateOfTime)>@Model.SellerKpiPersonBodyModel.PersonReport.DJKHWCJD.toInt()%</td>
                        
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.DJKHJDC >= 0)>@Model.SellerKpiPersonBodyModel.PersonReport.DJKHJDC.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.SaleRate >= Model.SellerKpiPersonBodyModel.PersonReport.RateOfTime)>@Model.SellerKpiPersonBodyModel.PersonReport.SaleRate.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.SCLDDJLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.SCLDDJLV)>@Model.SellerKpiPersonBodyModel.PersonReport.SCLDDJLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.AKXQWZFXLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.AKXQWZFXLV)>@Model.SellerKpiPersonBodyModel.PersonReport.AKXQWZFXLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.SCSJLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.SCSJLV)>@Model.SellerKpiPersonBodyModel.PersonReport.SCSJLV.toInt()%</td>
                        
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.SCSJCJLV <= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.SCSJCJLV)>@Model.SellerKpiPersonBodyModel.PersonReport.SCSJCJLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.STMXBTXLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.STMXBGTXLV)>@Model.SellerKpiPersonBodyModel.PersonReport.STMXBTXLV.toInt()%</td>
                        <td class="calculated"  @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.SYKHZHLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.SYKHZHLV)>@Model.SellerKpiPersonBodyModel.PersonReport.SYKHZHLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.DYDJKHCJLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.DJKHCJLV)>@Model.SellerKpiPersonBodyModel.PersonReport.DYDJKHCJLV.toInt()%</td>
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.DDJCZHLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.DDJCZHLV)>@Model.SellerKpiPersonBodyModel.PersonReport.DDJCZHLV.toInt()%</td>
                        
                        <td class="calculated" @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.CXJGCJLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.CXJGCJLV)>@Model.SellerKpiPersonBodyModel.PersonReport.CXJGCJLV.toInt()%</td>
                        
                        <td class="calculated"  @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.ECYYCGLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.ECYYCGLV)>@Model.SellerKpiPersonBodyModel.PersonReport.ECYYCGLV.toInt()%</td>
                        <td class="calculated"  @S4Store.Utils.GetBgColor(Model.SellerKpiPersonBodyModel.PersonReport.LKHTJCGLV >= Model.SellerKpiPersonBodyModel.PersonReport.SellerPerformanceStandard.LKHTJCGLV)>@Model.SellerKpiPersonBodyModel.PersonReport.LKHTJCGLV.toInt()%</td>
                    </tr>
                                                                                                                                                                                                               if (Model.SellerKpiPersonBodyModel.StoreReport.SellerBrandCount > 0)
                                                                                                                                                                                                               {
                                                                                                                                                                                                                   var avgReport = new S4Store.Domain.Report.AvgSellerReport(Model.SellerKpiPersonBodyModel.StoreReport.SellerBrandCount, Model.SellerKpiPersonBodyModel.StoreReport);
        <tr height="26" style="height:19.5pt" class="xl65">                        
                            <td colspan="18">考核标准</td>


                       <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.RateOfTime.toInt()%</td>
                        <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.RateOfTime.toInt()%</td>
                        <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.RateOfTime.toInt()%</td>
                        <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.RateOfTime.toInt()%</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.RateOfTime.toInt()%</td>
                        
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.RateOfTime.toInt()%</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.RateOfTime.toInt()%</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.SCLDDJLV.toInt()%</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.AKXQWZFXLV.toInt()%</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.SCSJLV.toInt()%</td>
                        
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.SCSJCJLV.toInt()%</td>
                        <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.STMXBGTXLV.toInt()%</td>
                        <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.SYKHZHLV.toInt()%</td>
                        <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.DYDJKHCJLV.toInt()%</td>
                        <td class="calculated" >@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.DDJCZHLV.toInt()%</td>
                        
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.CXJGCJLV.toInt()%</td>
                        
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.ECYYCGLV.toInt()%</td>
                        <td class="calculated">@Model.SellerKpiPersonBodyModel.StoreReport.SellerPerformanceStandard.LKHTJCGLV.toInt()%</td>
                    </tr>
                                                                                                                                                                                                               }
}
        </table>
</div>

